﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl" %>
<script type="text/javascript" src="<%: Url.Content("~/Scripts/js/khachhang.js") %>"></script>

<% List<Data.DBOES.Membership> objList = (List<Data.DBOES.Membership>)ViewData["ListKhachHang"];
      if (objList.Count > 0)
      {
          int idpage = (int)ViewData["IdForm"];
                   %>
        <td valign="top">
			<div class="firstcol">           
                   <table class="LeftTable" cellspacing="0" cellpadding="0" >
                   <%
                       int limitpage = (int)ViewData["LimitPage"];
                    int currpage = (int)ViewData["PageCurr"];
                       int stt = 1;
                    foreach (var obj in objList)
                    { 
                    %>
                    <tr>
                    <td class="tableFirstCol" style="width:50px;"><%: (stt+(limitpage*(currpage-1))).ToString()%></td>
						<td>
                        	<a href="javascript:Delete(<%: idpage %>,'<%: obj.IdMembership %>')" title=""><img src="/Content/images/add.png" width="15" height="15" alt="Xóa khách hàng" title="Xóa dòng <%= obj.MembershipName %>"/></a>
                            <a href="javascript:Edit(<%: idpage %>,'<%: obj.IdMembership %>')" title=""><img src="/Content/images/edit.png" width="15" height="15" alt="Sửa khách hàng"  title="Sửa dòng <%= obj.MembershipName %>"/></a>
                            <% if (obj.IsActive == false)
                               { 
                                %>
                                <a href="javascript:OK(<%: idpage %>,'<%: obj.IdMembership %>')" title=""><img src="/Content/images/ok.jpg" width="15" height="15" alt="Duyệt dòng đã sửa"  title="Duyệt dòng đã sửa"/></a>
                                <%
                               }      
                              %>
                            
                        </td>
                        
					</tr>
                    <%
                        stt++;
                    }
                   %>
                   </table>
			</div>
		</td>
		
		<td valign="top">
			<div class="table_div" onscroll="fnScroll()" >
				<table class="MainTable" cellspacing="0" cellpadding="0" >
                   <%
                       int count = 1;
                    foreach (var obj in objList)
                    {
                        if (count == 1)
                        {
                            if (obj.IsActive==true)
                            {
                                %>
                                 <tr class='firstTr'>
                                <%
                            }
                            else
                            { 
                                %>
                                 <tr class='firstTr' style="background:url('/Content/images/bg_td_false.png') repeat-x">
                                <%
                            }
                            %>
                            
						      <td><a href="javascript:Edit(<%: idpage %>,'<%: obj.IdMembership %>')" title="<%= obj.MembershipName %>"><%= obj.MembershipName.ToString().Length > 20 ? obj.MembershipName.ToString().Substring(0, 20) : obj.MembershipName.ToString()%></a></td>
						        <td><a href="javascript:Edit(<%: idpage %>,'<%: obj.IdMembership %>')" title="<%= obj.Address %>"><%= obj.Address.ToString().Length > 20 ? obj.Address.ToString().Substring(0, 20) : obj.Address.ToString()%></a> </td>
						        <td><a href="javascript:Edit(<%: idpage %>,'<%: obj.IdMembership %>')" title="<%= obj.Phone %>"><%=  obj.Phone.ToString().Length > 20 ? obj.Phone.ToString().Substring(0, 20) : obj.Phone.ToString()%></a></td>
						        <td><a href="javascript:Edit(<%: idpage %>,'<%: obj.IdMembership %>')" title=""><%= obj.Email%></a></td>
						        
                                
					        </tr>
                            <%
                            count++;
                        }
                        else
                        { 
                             if (obj.IsActive==true)
                            {
                                %>
                                 <tr>
                                <%
                            }
                            else
                            { 
                                %>
                                 <tr style="background:url('/Content/images/bg_td_false.png') repeat-x">
                                <%
                            }
                         
                            %>
						       <td><a href="javascript:Edit(<%: idpage %>,'<%: obj.IdMembership %>')" title="<%= obj.MembershipName %>"><%= obj.MembershipName.ToString().Length > 20 ? obj.MembershipName.ToString().Substring(0, 20) : obj.MembershipName.ToString()%></a></td>
						        <td><a href="javascript:Edit(<%: idpage %>,'<%: obj.IdMembership %>')" title="<%= obj.Address %>"><%= obj.Address.ToString().Length > 20 ? obj.Address.ToString().Substring(0, 20) : obj.Address.ToString()%></a> </td>
						        <td><a href="javascript:Edit(<%: idpage %>,'<%: obj.IdMembership %>')" title="<%= obj.Phone %>"><%=  obj.Phone.ToString().Length > 20 ? obj.Phone.ToString().Substring(0, 20) : obj.Phone.ToString()%></a></td>
						        <td><a href="javascript:Edit(<%: idpage %>,'<%: obj.IdMembership %>')" title=""><%= obj.Email%></a></td>
						        
                                
					        </tr>
                            <%
                                count++;
                        }                    
                    }
                   %>
                      </table>
			</div>
		</td> 
      <%
      }
      else
      { 
        %>
        <td valign="top">
			<div class="firstcol">           
                   <table class="LeftTable" cellspacing="0" cellpadding="0" >                   
                    <tr>
						<td class="tableFirstCol">
                        	
                        </td>
						<td></td>
					</tr>                    
                   </table>
			</div>
		</td>
		
		<td valign="top">
			<div class="table_div" onscroll="fnScroll()" >
				<table class="MainTable" cellspacing="0" cellpadding="0" >                  
                   <tr class='firstTr'>
						<td></td>
						<td></td>
                        <td></td>
                        <td></td>
                        
					</tr>
                      </table>
			</div>
		</td>
        <%
      }
      %>